﻿<?xml version="1.0" encoding="UTF-8" ?>
<mappings>
	<!--map template-->
	<!--REMEMBER: CASE SENSITIVE-->
	<!--<map type="relational" class="Namespace.class" storage="Schema.Table" storageType="table">
		<table>
			<column name="ColumnName" property="PropertyName" primaryKey="true|false"/>
			<column name="ColumnName" property="PropertyName"/> 
		</table>
		<commands>
			<command name="schema.storedprocedure" type="CRUD enumeration types or custom strings" idDataType="datatype" > idDataType is needed for Create commands
				<parameters>Parameters collection are optional. Not needed for return all commands
					<parameter name="@parameter" property="Property" type="int|varchar(50),etc." direction="Input|Output" class="Namespace.Class" />
				</parameters>
				<returnTable>Optional. Must be a parameters collection, a returnTable or both.
					If the espected value is of a record to construct an object then the property values are needed
					<column name="ColumnName" property="PropertyName" primaryKey="true|false"></column> primaryKey attribute is needed for define the PO correctly with an OID			 
					Property name value of ID is interpreteed as a reference key of another record (FK) or another value not associated with the mapped object.
				</returnTable>
			</command>	   	
		</commands>
	</map>-->
	<!--NOTE: This is a mapping file example. Eventually it must be neccessary to define namespaces and a schema-->

	<map type="relational" class="Klod.DigitalLibrary.Activities.LibraryWorkingSession" storage="[Operation].[WorkingSessions]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="Name" property="" />
			<column name="Description" property="" />
			<column name="StartAt" property="" />
			<column name="EndAt" property="" />
			<column name="WorkerID" property="" />
			<column name="WorkingSessionTypeID" property=""/>
		</table>
		<commands>
			<command name="[Operation].[CreateWorkingSession]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="" type="bigint" direction="ReturnValue"/>
					<parameter name="@name" property="Name" type="nvarchar(50)" direction="Input"/>
					<parameter name="@description" property="Description" type="nvarchar(100)" direction="Input"/>
					<parameter name="@startAt" property="StartAt" type="datetime" direction="Input"/>
					<parameter name="@workerID" property="ID" type="uniqueidentifier" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="LibraryUserOID"/>
					<parameter name="@workingSessionTypeID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="LibraryWorkingSessionTypeOID"/>
				</parameters>
			</command>
			<command name="[Operation].[UpdateWorkingSession]" type="Update">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
					<parameter name="@endAt" property="EndAt" type="datetime" direction="Input"/>
				</parameters>
			</command>
		</commands>
	</map>

	<map type="relational" class="Klod.Data.Storage.File" storage="[Data].[Files]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="DocumentFile" property="" />
			<column name="MimeContentTypeID" property=""/>
			<column name="EncodingTypeID" property=""/>
		</table>
		<commands>
			<command name="[Data].[RetrieveAllResourcesByCriteria]" type="RetrieveAllResourcesByCriteria">
				<parameters>
					<parameter name="@criteria" property="Criteria" type="nvarchar(4000)" direction="Input"/>
					<parameter name="@searchFileOption" property="SearchFileOption" type="tinyint" direction="Input"/>
					<parameter name="@creator" property="ID" type="uniqueidentifier" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
				</parameters>
				<returnTable name="Files">
					<column name="ResourceID"/>
					<column name="Resource"/>
					<column name="Type"/>
					<column name="Content"/>
				</returnTable>
			</command>
			<command name="[Data].[RetrieveFile]" type="Retrieve">
				<parameters>
					<parameter name="@fileID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="File">
					<column name="DocumentFile" property="Data"/>
					<column name="Extension" property="Extension"/>
					<column name="Encoding" property="ID"/>
				</returnTable>
			</command>
			<command name="[Data].[RetrieveFileIDFromResource]" type="RetrieveFileIDFromResource">
				<parameters>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="File">
					<column name="FileID" property="ID" primaryKey="true"/>
				</returnTable>
			</command>
			<command name="[Metadata].[RetrieveResourceMainMetadata]" type="RetrieveResourceMainMetadata">
				<parameters>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="MainMetadata">
					<column name="UniformTitle" property="Title"/>
					<column name="Extension" property="Extension"/>
					<column name="ResourceType" property="ID"/>
					<column name="ContentType" property="ID"/>
				</returnTable>
			</command>
			<command name="[Data].[CreateFile]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="ID" type="bigint" direction="ReturnValue"/>
					<parameter name="@documentFile" property="Data" type="varbinary(MAX)" direction="Input"/>
					<parameter name="@uniformTitle" property="Title" type="nvarchar(100)" direction="Input"/>
					<parameter name="@extension" property="Extension" type="nvarchar(10)" direction="Input"/>
					<parameter name="@workingSessionID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
					<parameter name="@authors" property="Value" type="nvarchar(100)" direction="Input" class="Klod.DigitalLibrary.Prototype.Application.Viewers.ResourceMetadataItemViewer" token="Authors"/>
					<parameter name="@description" property="Value" type="nvarchar(500)" direction="Input" class="Klod.DigitalLibrary.Prototype.Application.Viewers.ResourceMetadataItemViewer" token="Description"/>

				</parameters>
			</command>
			<command name="[Data].[UpdateUniformTitle]" type="UpdateUniformTitle">
				<parameters>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
					<parameter name="@uniformTitle" property="Title" type="nvarchar(100)" direction="Input"/>
				</parameters>
			</command>
		</commands>
	</map>

	<map type="relational" class="Klod.Data.Storage.TextFile" storage="[Data].[Files]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="TextContent" property="" />
			<column name="FileID" property=""/>
			<column name="TextEditionFormatID" property=""/>
		</table>
		<commands>

			<command name="[Data].[RetrieveFile]" type="Retrieve">
				<parameters>
					<parameter name="@fileID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="File">
					<column name="DocumentFile" property="Data"/>
					<column name="Extension" property="Extension"/>
					<column name="Encoding" property="ID"/>
				</returnTable>
			</command>
			<command name="[Data].[CreateFile]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="ID" type="bigint" direction="ReturnValue"/>
					<parameter name="@documentFile" property="Data" type="varbinary(MAX)" direction="Input"/>
					<parameter name="@uniformTitle" property="Title" type="nvarchar(100)" direction="Input"/>
					<parameter name="@extension" property="Extension" type="nvarchar(10)" direction="Input"/>
					<parameter name="@encoding" property="EncodingWebName" type="nvarchar(20)" direction="Input"/>
					<parameter name="@workingSessionID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
					<parameter name="@authors" property="Value" type="nvarchar(100)" direction="Input" class="Klod.DigitalLibrary.Prototype.Application.Viewers.ResourceMetadataItemViewer" token="Authors" />
					<parameter name="@description" property="Value" type="nvarchar(500)" direction="Input" class="Klod.DigitalLibrary.Prototype.Application.Viewers.ResourceMetadataItemViewer" token="Description"/>

				</parameters>
			</command>
			<command name="[Data].[CreateTextEdition]" type="CreateTextEdition" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="ID" type="bigint" direction="ReturnValue"/>
					<parameter name="@textContent" property="Content" type="nvarchar(MAX)" direction="Input"/>
					<parameter name="@fileID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="FileOID"/>
					<parameter name="@editingSessionID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="UploadSessionOID"/>
					<parameter name="@uniformTitle" property="Title" type="nvarchar(100)" direction="Input"/>
					<parameter name="@textEditionFormatID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="TextEditionFormatOID"/>
					<parameter name="@authors" property="Value" type="nvarchar(100)" direction="Input" class="Klod.DigitalLibrary.Prototype.Application.Viewers.ResourceMetadataItemViewer"/>
				</parameters>
			</command>
			<command name="[Data].[RetrieveTextEdition]" type="RetrieveTextEdition">
				<parameters>
					<parameter name="@editionID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="TextEdition">
					<column name="TextContent" property="Content"/>
					<column name="FileID" property="ID"/>
					<column name="TextEditionFormatID" property="ID"/>
					<column name="Extension" property="Extension"/>
				</returnTable>
			</command>
		</commands>
	</map>

	<map type="relational" class="Klod.Data.Storage.MimeContentType" storage="[EntityType].[MimeContentTypes]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="ExtensionType" property="" />
			<column name="Type" property="" />
			<column name="MimeType" property="" />
			<column name="MimeSubType" property="" />
		</table>
		<commands>
			<command name="[EntityType].[RetrieveAllMimeContentTypes]" type="RetrieveAll">
				<returnTable name="MimeContentTypes">
					<column name="ID" property=""/>
					<column name="ExtensionType" property=""/>
					<column name="Type" property=""/>
					<column name="MimeType" property=""/>
					<column name="MimeSubType" property=""/>
				</returnTable>
			</command>
			<!--<command name="[EntityType].[RetrieveMimeContentTypes]" type="Retrieve">
				<parameters>
					<parameter name="@extensionID" property="" type="nvarchar(20)" direction="Input"/>
				</parameters>
				<returnTable name="MimeContentTypes">
					<column name="Extension" property=""/>
					<column name="Type" property=""/>
					<column name="MimeType" property=""/>
					<column name="MimeSubType" property=""/>
				</returnTable>
			</command>
			<command name="[EntityType].[CreateMimeContentTypes]" type="Create" idDataType="nvarchar(20)">
				<parameters>
					<parameter name="@extensionID" property="" type="nvarchar(20)" direction="Input"/>
					<parameter name="@extension" property="" type="nvarchar(100)" direction="Input"/>
					<parameter name="@type" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@mimeType" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@mimeSubType" property="" type="nvarchar(200)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[UpdateMimeContentTypes]" type="Update">
				<parameters>
					<parameter name="@extensionID" property="" type="nvarchar(20)" direction="Input"/>
					<parameter name="@extension" property="" type="nvarchar(100)" direction="Input"/>
					<parameter name="@type" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@mimeType" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@mimeSubType" property="" type="nvarchar(200)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[DeleteMimeContentTypes]" type="Delete">
				<parameters>
					<parameter name="@extensionID" property="" type="nvarchar(20)" direction="Input"/>
				</parameters>
			</command>-->
		</commands>
	</map>

	<map type="relational" class="Klod.DigitalLibrary.Prototype.Information.Metadata.MetadataItem" storage="[Metadata].[GeneralMetadataItems]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="Term" property="" />
			<column name="Value" property="" />
			<column name="MetadataSetID" property="" />
			<column name="WorkingSessionID" property=""/>
		</table>
		<commands>
			<command name="[Metadata].[RetrieveAllGeneralMetadataItems]" type="RetrieveAllGenericMetadataItemsByFile">
				<parameters>
					<parameter name="@resourceId" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="GeneralMetadataItems">
					<column name="ID" />
					<column name="Term" />
					<column name="Value" />
				</returnTable>
			</command>
			<command name="[Metadata].[RetrieveGeneralMetadataItem]" type="Retrieve">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="GeneralMetadataItem">
					<column name="Term" property="Term"/>
					<column name="Value" property="Value"/>
				</returnTable>
			</command>
			<command name="[Metadata].[CreateMetadataItem]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="ID" type="bigint" direction="ReturnValue"/>
					<parameter name="@metadataTypeID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="MetadataTypeOID"/>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="ResourceOID"/>
					<parameter name="@workingSessionID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="LibraryWorkingSessionOID"/>
					<parameter name="@term" property="Term" type="nvarchar(50)" direction="Input"/>
					<parameter name="@value" property="Value" type="nvarchar(4000)" direction="Input"/>
				</parameters>
			</command>
			<command name="[Metadata].[UpdateGeneralMetadataItem]" type="Update">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" />
					<parameter name="@value" property="Value" type="nvarchar(4000)" direction="Input"/>
				</parameters>
			</command>
			<command name="[Metadata].[DeleteGeneralMetadataItem]" type="Delete">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input"/>
				</parameters>
			</command>
		</commands>
	</map>

	<map type="relational" class="Klod.DigitalLibrary.Prototype.Information.Metadata.DublinCore._1_1.DublinCoreMetadataElement" storage="[Metadata].[DublinCoreMetadataItems]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="DublinCoreMetadataElementSetTerm" property="" />
			<column name="Value" property="" />
			<column name="MetadataSetID" property="" />
			<column name="WorkingSessionID" property=""/>
		</table>
		<commands>
			<command name="[Metadata].[RetrieveAllDublinCoreMetadataElements]" type="RetrieveAll">
				<parameters>
					<parameter name="@language" property="Value" type="nvarchar(10)" direction="Input"/>
				</parameters>
				<returnTable name="DublinCoreMetadataElements">
					<column name="Term" property=""/>
					<column name="Label" property=""/>
					<column name="Definition" property=""/>
					<column name="Comment" property=""/>
					<column name="Language" property=""/>
				</returnTable>
			</command>
			<command name="[Metadata].[RetrieveAllDublinCoreMetadataItems]" type="RetrieveAllDublinCoreMetadataByFile">
				<parameters>
					<parameter name="@resourceId" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="DublinCoreMetadataItems">
					<column name="ID" property=""/>
					<column name="DublinCoreMetadataElementSetTerm" property=""/>
					<column name="Value" property=""/>
				</returnTable>
			</command>
			<command name="[Metadata].[RetrieveDublinCoreMetadataItem]" type="Retrieve">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="DublinCoreMetadataItems">
					<column name="Element" property="Term"/>
					<column name="Value" property="Value"/>
				</returnTable>
			</command>
			<command name="[Metadata].[CreateMetadataItem]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="ID" type="bigint" direction="ReturnValue"/>
					<parameter name="@metadataTypeID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="MetadataTypeOID"/>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="ResourceOID"/>
					<parameter name="@workingSessionID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="LibraryWorkingSessionOID"/>
					<parameter name="@term" property="Term" type="nvarchar(50)" direction="Input"/>
					<parameter name="@value" property="Value" type="nvarchar(4000)" direction="Input"/>
				</parameters>
			</command>
			<command name="[Metadata].[UpdateDublinCoreMetadataItem]" type="Update">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID"/>
					<parameter name="@value" property="Value" type="nvarchar(4000)" direction="Input"/>
				</parameters>
			</command>
			<command name="[Metadata].[DeleteDublinCoreMetadataItem]" type="Delete">
				<parameters>
					<parameter name="@iD" property="ID" type="bigint" direction="Input"/>
				</parameters>
			</command>
		</commands>
	</map>

	<map type="relational" class="System.Text.Encoding" storage="[EntityType].[EncodingTypes]" storageType="table">
		<table>
			<column name="Name" property="" primaryKey="true"/>
			<column name="Description" property="" />
		</table>
		<commands>
			<command name="[EntityType].[RetrieveAllEncodingTypes]" type="RetrieveAll">
				<returnTable name="EncodingTypes">
					<column name="Name" property=""/>
					<column name="Description" property=""/>
				</returnTable>
			</command>
			<!--<command name="[EntityType].[RetrieveEncodingTypes]" type="Retrieve">
				<parameters>
					<parameter name="@encoding" property="" type="nchar(20)" direction="Input"/>
				</parameters>
				<returnTable name="EncodingTypes">
					<column name="Description" property=""/>
				</returnTable>
			</command>
			<command name="[EntityType].[CreateEncodingTypes]" type="Create" idDataType="nchar(20)">
				<parameters>
					<parameter name="@encoding" property="" type="nchar(20)" direction="Input"/>
					<parameter name="@description" property="" type="nvarchar(50)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[UpdateEncodingTypes]" type="Update">
				<parameters>
					<parameter name="@encoding" property="" type="nchar(20)" direction="Input"/>
					<parameter name="@description" property="" type="nvarchar(50)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[DeleteEncodingTypes]" type="Delete">
				<parameters>
					<parameter name="@encoding" property="" type="nchar(20)" direction="Input"/>
				</parameters>
			</command>-->
		</commands>
	</map>

	<map type="relational" class="Klod.DigitalLibrary.Reading.Annotation" storage="[Data].[Annotations]" storageType="table">
		<table>
			<column name="ID" property="" primaryKey="true"/>
			<column name="Title" property=""/>
			<column name="Annotation" property="" />
			<column name="CreatedBy" property="" />
			<column name="CreationDate" property="" />
			<column name="LastModification" property=""/>
			<column name="Parragraph" property="" />
			<column name="Word" property="" />
			<column name="Instance" property="" />
			<column name="ResourceID" property="" />
			<column name="AnnotationTypeID" property="" />
		</table>
		<commands>
			<command name="[Data].[RetrieveAllAnnotationsInResourceByReader]" type="RetrieveAllAnnotationsInResourceByReader">
				<parameters>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input"/>
					<parameter name="@readerID" property="ID" type="uniqueidentifier" direction="Input"/>
				</parameters>
				<returnTable name="AnnotationsByReader">
					<column name="ID" property=""/>
					<column name="Title" property=""/>
					<column name="Annotation" property=""/>
					<column name="CreatedBy" property=""/>
					<column name="CreationDate" property=""/>
					<column name="LastModification" property=""/>
					<column name="Parragraph" property=""/>
					<column name="Word" property=""/>
					<column name="Instance" property=""/>
					<column name="ResourceID" property=""/>
					<column name="AnnotationTypeID" property=""/>
				</returnTable>
			</command>
			<command name="[Data].[RetrieveAllAnnotationsInResourceByReaderAndWord]" type="RetrieveAllAnnotationsInResourceByReaderAndWord">
				<parameters>
					<parameter name="@readerID" property="ID" type="uniqueidentifier" direction="Input"/>
					<parameter name="@parragraph" property="Parragraph" type="nvarchar(50)" direction="Input"/>
					<parameter name="@word" property="Word" type="nvarchar(50)" direction="Input"/>
					<parameter name="@instance" property="WordInstance" type="smallint" direction="Input"/>
				</parameters>
				<returnTable name="AnnotationsByWord">
					<column name="ID" property=""/>
					<column name="Title" property=""/>
					<column name="Annotation" property=""/>
					<column name="CreatedBy" property=""/>
					<column name="LastModification" property=""/>
					<column name="CreationDate" property=""/>
					<column name="Parragraph" property=""/>
					<column name="Word" property=""/>
					<column name="Instance" property=""/>
					<column name="ResourceID" property=""/>
					<column name="AnnotationTypeID" property=""/>
				</returnTable>
			</command>
			<command name="[Data].[RetrieveAnnotation]" type="Retrieve">
				<parameters>
					<parameter name="@annotationID" property="ID" type="bigint" direction="Input"/>
				</parameters>
				<returnTable name="Annotation">
					<column name="Title" property="Title"/>
					<column name="Annotation" property="Content"/>
					<column name="CreatedBy" property="ID"/>
					<column name="LastModification" property="ModifiedIn"/>
					<column name="CreationDate" property="CreatedAt"/>
					<column name="Parragraph" property="Parragraph"/>
					<column name="Word" property="Word"/>
					<column name="Instance" property="WordInstance"/>
					<column name="ResourceID" property="ID"/>
					<column name="AnnotationTypeID" property="ID"/>
				</returnTable>
			</command>
			<command name="[Data].[CreateAnnotation]" type="Create" idDataType="bigint">
				<parameters>
					<parameter name="@RETURN_VALUE" property="" type="bigint" direction="ReturnValue"/>
					<parameter name="@title" property="Title" type="nvarchar(50)" direction="Input"/>
					<parameter name="@annotation" property="Content" type="nvarchar(MAX)" direction="Input"/>
					<parameter name="@createdBy" property="ID" type="uniqueidentifier" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="ReaderOID"/>
					<parameter name="@creationDate" property="CreatedAt" type="datetime" direction="Input"/>
					<parameter name="@parragraph" property="Parragraph" type="nvarchar(50)" direction="Input"/>
					<parameter name="@word" property="Word" type="nvarchar(50)" direction="Input"/>
					<parameter name="@instance" property="WordInstance" type="smallint" direction="Input"/>
					<parameter name="@resourceID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="ResourceOID"/>
					<parameter name="@annotationTypeID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="AnnotationTypeOID"/>
				</parameters>
			</command>
			<command name="[Data].[UpdateAnnotation]" type="Update">
				<parameters>
					<parameter name="@annotationID" property="ID" type="bigint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="AnnotationOID"/>
					<parameter name="@title" property="Title" type="nvarchar(50)" direction="Input" />
					<parameter name="@annotation" property="Content" type="nvarchar(MAX)" direction="Input"/>
					<parameter name="@annotationTypeID" property="ID" type="tinyint" direction="Input" class="Klod.Data.PersistenceService.Identifiers.OID" token="AnnotationTypeOID"/>
				</parameters>
			</command>
			<command name="[Data].[DeleteAnnotation]" type="Delete">
				<parameters>
					<parameter name="@annotationID" property="ID" type="bigint" direction="Input" />
				</parameters>
			</command>
		</commands>
	</map>

	<map type="relational" class="Klod.DigitalLibrary.Reading.AnnotationDataType" storage="[EntityType].[AnnotationTypeCultures]" storageType="table">
		<table>
			<column name="ID" property="" />
			<column name="Name" property="" />
			<column name="Description" property="" />
			<column name="Language" property="" />
		</table>
		<commands>
			<command name="[EntityType].[RetrieveAllAnnotationTypes]" type="RetrieveAll">
				<parameters>
					<parameter name="@language" property="Value" type="nvarchar(10)" direction="Input"/>
				</parameters>
				<returnTable name="AnnotationTypeCultures">
					<column name="ID" property=""/>
					<column name="Name" property=""/>
					<column name="Description" property=""/>
					<column name="Language" property=""/>
				</returnTable>
			</command>
			<!--<command name="[EntityType].[RetrieveAnnotationTypeCultures]" type="Retrieve">
				<parameters>
				</parameters>
				<returnTable name="AnnotationTypeCultures">
					<column name="ID" property=""/>
					<column name="Name" property=""/>
					<column name="Description" property=""/>
					<column name="Language" property=""/>
				</returnTable>
			</command>-->
			<!--<command name="[EntityType].[CreateAnnotationTypeCultures]" type="Create" idDataType="">
				<parameters>
					<parameter name="@iD" property="" type="tinyint" direction="Input"/>
					<parameter name="@name" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@description" property="" type="nvarchar(100)" direction="Input"/>
					<parameter name="@language" property="" type="nvarchar(10)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[UpdateAnnotationTypeCultures]" type="Update">
				<parameters>
					<parameter name="@iD" property="" type="tinyint" direction="Input"/>
					<parameter name="@name" property="" type="nvarchar(50)" direction="Input"/>
					<parameter name="@description" property="" type="nvarchar(100)" direction="Input"/>
					<parameter name="@language" property="" type="nvarchar(10)" direction="Input"/>
				</parameters>
			</command>
			<command name="[EntityType].[DeleteAnnotationTypeCultures]" type="Delete">
				<parameters>
				</parameters>
			</command>-->
		</commands>
	</map>


</mappings>
